import { createRouter, createWebHashHistory } from "vue-router";
import MainLayout from "@/layout/main.vue";
const router = createRouter({
  history: createWebHashHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: "",
      component: MainLayout,
      children: [
        // 拜访报告
        {
          name: "home",
          path: "/home",
          component: () => import("@/views/home/index.vue"),
          meta: { title: "拜访报告" },
        },
        {
          name: "detail",
          path: "/detail",
          component: () => import("@/views/home/detail.vue"),
          meta: { title: "报告详情" },
        },
        {
          name: "addTroops",
          path: "/addTroops",
          component: () => import("@/views/troops/addTroops.vue"),
          meta: { title: "新增报告" },
        },
        {
          name: "user",
          path: "/user",
          component: () => import("@/views/user/index.vue"),
        },
        // 出差计划
        {
          name: "evection",
          path: "/evection",
          component: () => import("@/views/evection/index.vue"),
          meta: { title: "出差计划" },
        },
        {
          name: "apply",
          path: "/apply",
          component: () => import("@/views/evection/components/apply.vue"),
          meta: { title: "新增计划" },
        },
        //产品型号
        {
          name: "model",
          path: "/model",
          component: () => import("@/views/model/index.vue"),
          meta: { title: "产品型号" },
        },
        {
          name: "modelDetail",
          path: "/modelDetail",
          component: () => import("@/views/model/detail.vue"),
          meta: { title: "产品型号详情" },
        },
        //钉钉日报
        {
          name: "log",
          path: "/log",
          component: () => import("@/views/log/log.vue"),
          meta: { title: "日志" },
        },
        {
          name: "addTemp",
          path: "/addTemp",
          component: () => import("@/views/log/components/addTemp.vue"),
          meta: { title: "创建模板" },
        },
        {
          name: "permissionLog",
          path: "/permissionLog",
          component: () => import("@/views/log/components/permissionLog.vue"),
          meta: { title: "权限设置" },
        },
        {
          name: "writeLog",
          path: "/writeLog",
          component: () => import("@/views/log/components/writeLog.vue"),
          meta: { title: "写日志" },
        },
        {
          name: "readLogInfo",
          path: "/readLogInfo",
          component: () => import("@/views/log/components/readLogInfo.vue"),
          meta: { title: "看日志" },
        },
      ],
    },
  ],
});

export default router;
